//
//  UILable+Extension.swift
//  weibo
//
//  Created by 王玉东 on 16/4/13.
//  Copyright © 2016年 wyd. All rights reserved.
//

import UIKit

extension UILabel {

    convenience init(text:String, fontSize:CGFloat ,textColor:UIColor,margin:CGFloat = 0){
        
    self.init()
        
    self.text = text
        
    self.font = UIFont.systemFontOfSize(fontSize) //字体大小
        
    self.textColor = textColor //颜色
        
    numberOfLines = 0
        
    self.textAlignment = .Center//居中设置
        
        if margin > 0 {
        
            preferredMaxLayoutWidth = ScreenWidth - 2 * margin
            
            textAlignment = .Left
        
        }
        
    sizeToFit()
        
    
    }
    
}
